home *** CD-ROM | disk | FTP | other *** search
- const
- lines=140; {This is number of lines per column.}
- columns=2; {This is number of 66 character columns.}
- {150 lines and 2 columns gives maximum density for 8.5x11
- inch paper, about 20k}
-
- initstring=#27'3'#15#27'S0'#15; {This is the printer init string. It
- sets Superscript, 15/216 inch line
- spacing, and compressed print. Change
- this string for non Epson compatible
- printers.}
-
- resetstring=#27'@';
-
- type
- linetype=string[66];
- pagetype=array[1..columns,1..lines] of linetype;
-
- var
- page:pagetype;
- infile,outfile:text;
- linesread,a,b,i,j:integer;
- inname:string[20];
- EndOfFile : boolean;
-
- function rl:linetype;
- var
- s:linetype;
- c:char;
- begin
- s:='';
- repeat
- read(infile,c);
- if (c<>#13) and (c<>#10) then
- s:=s+c;
- until eoln(infile) or (length(s)=64);
- rl:=s;
- end;
-
- function pad(s:linetype):linetype;
- var
- s1:linetype;
- begin
- s1:=s;
- while length(s1)<66 do
- s1:=s1+' ';
- pad:=s1;
- end;
-
- begin
- If Paramstr(1) = '' then
- begin
- write('Enter input filename: '); readln(inname)
- end
- else inname := ParamStr(1);
- assign(infile,inname);
- reset(infile);
- writeln(lst,initstring);
- repeat
- j:=0;
- linesread:=0;
- writeln('Reading....');
- repeat
- j:=j+1;
- i:=0;
- repeat
- i:=i+1;
- linesread:=linesread+1;
- page[j,i]:=rl;
- EndOfFile := Eof(infile);
- until (i=lines) or EndOfFile;
- until (j=columns) or (EndOfFile);
- writeln(linesread);
- b:=0;
- if j=columns then linesread:=linesread-(lines*(j-1));
- if j>1 then i:=lines;
- writeln('Printing....');
- repeat
- b:=b+1;
- a:=0;
- repeat
- a:=a+1;
- write(lst,pad(page[a,b]));
- until (a=j);
- linesread:=linesread-1;
- if linesread=0 then j:=j-1;
- writeln(lst);
- until (b=i);
- Writeln(lst,#12)
- until EndOfFile;
- close(infile);
- write(lst,resetstring)
- end.